#import <UIKit/UIKit.h>
#import "Building.h"
#import "SFUConstants.h"
#import "EventManager.h"
#import "FoursquareManager.h"
#import "FoursquareViewDelegate.h"
#import "MapBuildingSearchDelegate.h"

/**
 * An BuildingViewer is an object representing the view that 
 * displays information regarding a given SFU building.
 *
 * Conforms to the UIScrollViewDelegate protocol.
 * Conforms to the MapBuildingSearchDelegate protocol.
 *
 * @author      James Lin
 * @version     2.2.7
 * @since       2.2.3
 * @see         UIScrollViewDelegate
 * @see         FoursquareViewDelegate
 * @see         MapBuildingSearchDelegate
 */
@interface BuildingViewer : UIViewController <UIScrollViewDelegate, 
											  FoursquareViewDelegate, 
											  MapBuildingSearchDelegate> {
	id<MapBuildingSearchDelegate> delegate;          // Delegate handling building searches
	UIScrollView*                 buildingInfoView;  // The scrollable building view
	CGFloat                       contentHeight;     // Height of all view content
	Building*                     buildingInfo;      // Building to display
	UINavigationController*       parentNav;         // Navigation controller of parent view
	UIImageView*                  imageView;         // View for building photos
	NSInteger                     currentImageIndex; // Current index of building photo
	UIPageControl*                pageControl;       // Page control for building photos
}

/**
 * Retrieve the shared instance of the building viewer.
 *
 * @return  the shared instance of BuildingViewer
 */
+ (BuildingViewer*)sharedBuildingViewer;

/**
 * Display the building information in a new view.
 *
 * Pushes this view onto the navigation controller stack of the parent
 * view. Upon tapping the back button, the view is automatically 
 * popped off the top of the navigation stack.
 *
 * @param building       the building to display
 * @param navController  the navigation controller of the parent view
 * @param theDelegate    the delegate handling building search requests
 */
- (void)displayBuilding:(Building*)building 
		  navController:(UINavigationController*)navController 
			andDelegate:(id<MapBuildingSearchDelegate>)theDelegate;

@end
